Method and apparatus for generating HDRI

ABSTRACT

A method for generating a high dynamic range image (HDRI) includes acquiring a first illuminance diagram, generating a second illuminance diagram from the first illuminance diagram by modifying a dynamic range of at least a portion of the first illuminance diagram, and generating the HDRI based on the second illumination diagram. The first illuminance diagram is obtained based on a camera response function and an illuminance logarithm obtained based on a plurality of images having different exposure conditions.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application is a continuation application of application Ser. No.15/385,502, filed on Dec. 20, 2016, which is a continuation applicationof International Application No. PCT/CN2014/080376, filed with the StateIntellectual Property Office of P. R. China on Jun. 20, 2014, the entirecontents of both of which are incorporated herein by reference.

TECHNICAL FIELD

The present disclosure relates to the field of image processing and,particularly, to a method and apparatus for generating a high dynamicrange image (HDRI).

BACKGROUND OF THE DISCLOSURE

A high dynamic range image (HDRI) has a wider dynamic range, which maybe far wider than that can be rendered by an ordinary display device.Therefore, it is often necessary to compress the dynamic range of theHDRI when being generated in order to allow the HDRI to be displayed onan ordinary display device.

However, existing methods for generating HDRI may cause loss of thedetails in the HDRI.

SUMMARY OF THE DISCLOSURE

In view of the above, embodiments of the present disclosure provide amethod and an apparatus for generating an HDRI, which may solve theproblem of losing details in the HDRI generated with an existing method.

To achieve the above objectives, the disclosed embodiments of thepresent disclosure provide a technical solution as follows:

A first aspect of the present disclosure provides a method forgenerating an HDRI, comprising:

acquiring a first illuminance diagram;

generating a second illuminance diagram from the first illuminancediagram, the second illuminance diagram being formed by fusing a baselayer of which the dynamic range is compressed and detail layers, andthe base layer and the detail layers being extracted from the firstilluminance diagram;

mapping the second illuminance diagram onto preset color channels; and

fusing the images on the color channels into the HDRI.

In a first implementation of the first aspect of the present disclosure,said acquiring the first illuminance diagram may comprise:

generating a set of calibration equations for a camera response functionfrom images I1, I2, . . . , IN having different exposure conditions,wherein N is the number of the images, and is an integer greater than orequal to 2;

solving the set of calibration equations for the camera responsefunction by using a QR decomposition algorithm to obtain the cameraresponse function and an illuminance logarithm, based on sampling pixelpoints selected from the images I1, I2, . . . , IN; and

obtaining the first illuminance diagram based on the camera responsefunction and the illuminance logarithm.

In a second implementation of the first aspect of the presentdisclosure, said generating the set of calibration equations for thecamera response function from the images I1, I2, . . . , IN maycomprise:

acquiring the images I1, I2, . . . , IN; and

solving a preset objective function by a least square method to obtainthe set of calibration equations for the camera response function, byusing the images I1, I2, . . . , IN as known parameters.

In a third implementation of the first aspect of the present disclosure,the preset objective function may comprise:

$O = {{\sum\limits_{i = 1}^{M}{\sum\limits_{j = 1}^{N}{{\omega\left( Z_{i,j} \right)}\left\lbrack {{g\left( Z_{i,j} \right)} - {\ln\; E_{i}} - {\ln\;\Delta\; t_{j}}} \right\rbrack}^{2}}} + {\lambda{\sum\limits_{Z = {Z_{\min} + 1}}^{Z_{\max} - 1}{{\omega\left( Z_{i,j} \right)}\left\lbrack {g^{''}\left( z_{i,j} \right)} \right\rbrack}^{2}}}}$

wherein, M is a total number of the pixel points of each image among theknown parameters, g(Z_(i,j))=InE_(i)+InΔt_(j), E_(i) is a sceneilluminance, Δt_(j) is an exposure time of the current image Z_(i,j),Z_(i,j) is a pixel value of the current image, λ is a control parameter,ω(Z_(i,j)) is a weight function for the current image Z_(i,j), Z_(min)is a minimum value of the pixel value of the current image, and Z_(max)is a maximum value of the pixel value of the current image.

In a fourth implementation of the first aspect of the presentdisclosure, the method may further comprise, before fusing the images onthe color channels into the HDRI:

performing a Gamma correction respectively to the images on each of thecolor channels; and

fusing the images on the color channels into the HDRI may comprise:

fusing the Gamma-corrected images on the color channels into the HDRI.

In a fifth implementation of the first aspect of the present disclosure,said generating the second illuminance diagram from the firstilluminance diagram may comprise:

extracting the base layer and the detail layers of the first illuminancediagram;

compressing the dynamic range of the base layer into a preset range; and

fusing the base layer of which the dynamic range is compressed and thedetail layers into the second illuminance diagram.

In a sixth implementation of the first aspect of the present disclosure,extracting the base layer and the detail layers of the first illuminancediagram may comprise:

extracting the base layer and the detail layers of the first illuminancediagram by using a lifting wavelet transform algorithm; and

fusing the base layer of which the dynamic range is compressed and thedetail layers into the second illuminance diagram may comprise:

fusing the base layer of which the dynamic range is compressed and thedetail layers into the second illuminance diagram by using a liftingwavelet inverse transform algorithm.

A second aspect of the present disclosure provides an apparatus forgenerating HDRI, comprising:

an acquisition module for acquiring a first illuminance diagram;

a generation module for generating a second illuminance diagram from thefirst illuminance diagram, the second illuminance diagram being formedby fusing a base layer of which the dynamic range is compressed anddetail layers, and the base layer and the detail layers being extractedfrom the first illuminance diagram;

a mapping module for mapping the second illuminance diagram onto aplurality of preset color channels; and

a fusion module for fusing images on the plurality of preset colorchannels into the HDRI.

In a first implementation of the second aspect of the presentdisclosure, the acquisition module may specifically comprise:

an equation generating unit for generating a set of calibrationequations for a camera response function from images I1, I2, . . . , INhaving different exposure conditions, wherein N is a total number of theimages, and is an integer greater than or equal to 2;

a solving unit for solving the set of calibration equations for thecamera response function by using a QR decomposition algorithm to obtainthe camera response function and an illuminance logarithm, based onsampling pixel points selected from the images I1, I2, . . . , IN; and

an acquisition unit for obtaining the first illuminance diagram based onthe camera response function and the illuminance logarithm.

In a second implementation of the second aspect of the presentdisclosure, the equation generating unit for generating the set ofcalibration equations for the camera response function from the imagesI1, I2, . . . , IN may be used for:

acquiring the images I1, I2, . . . , IN, and solving a preset objectivefunction by a least square method to obtain the set of calibrationequations for the camera response function by using the images I1, I2, .. . , IN as known parameters.

In a third implementation of the second aspect of the presentdisclosure, the equation generating unit used for acquiring the imagesI1, I2, . . . , IN and solving the preset objective function by usingthe least square method to obtain the calibration equation set for thecamera response function by using the images I1, I2, . . . , IN as knownparameters may be used for:

acquiring the images I1, I2, . . . , IN, and solving the presetobjective function by using the least square method to obtain the set ofcalibration equations for the camera response function by using theimages I1, I2, . . . , IN as known parameters, and the preset objectivefunction may be:

$O = {{\sum\limits_{i = 1}^{M}{\sum\limits_{j = 1}^{N}{{\omega\left( Z_{i,j} \right)}\left\lbrack {{g\left( Z_{i,j} \right)} - {\ln\; E_{i}} - {\ln\;\Delta\; t_{j}}} \right\rbrack}^{2}}} + {\lambda{\sum\limits_{Z = {Z_{\min} + 1}}^{Z_{\max} - 1}{{\omega\left( Z_{i,j} \right)}\left\lbrack {g^{''}\left( z_{i,j} \right)} \right\rbrack}^{2}}}}$

wherein, M is the number of the pixel points of each image among theknown parameters, g(Z_(i,j))=InE_(i)+InΔt_(j), E_(i) is a sceneilluminance, Δt_(j) is an exposure time of the current image Z_(i,j),Z_(i,j) is a pixel value of the current image, λ is a control parameter,ω(Z_(i,j)) is a weight function for the current image Z_(i,j), Z_(min)is a minimum value of the pixel value of the current image, and Z_(max)is a maximum value of the pixel value of the current image.

In a fourth implementation of the second aspect of the presentdisclosure, the apparatus may further comprise:

a correction module for performing a Gamma correction respectively tothe images on each of the color channels before fusing the images on thecolor channels into the HDRI.

In a fifth implementation of the second aspect of the presentdisclosure, the fusion module for fusing the images on the colorchannels into the HDRI may be used for:

fusing the Gamma-corrected images on the color channels into the HDRI.

In a sixth implementation of the first second aspect of the presentdisclosure, the generation module may comprise:

an extraction unit for extracting the base layer and the detail layersof the first illuminance diagram;

a compression unit for compressing the dynamic range of the base layerinto a preset range; and

a fusion unit for fusing the base layer of which the dynamic range iscompressed and the detail layers into the second illuminance diagram.

In a seventh implementation of the second aspect of the presentdisclosure, the extraction unit for extracting the base layer and thedetail layers of the first illuminance diagram may be used for:

extracting the base layer and the detail layers of the first illuminancediagram by using a lifting wavelet transform algorithm.

In an eighth implementation of the second aspect of the presentdisclosure, the fusion unit for fusing the base layer of which thedynamic range is compressed and the detail layers into the secondilluminance diagram may be used for:

fusing the base layer of which the dynamic range is compressed and thedetail layers into the second illuminance diagram by using a liftingwavelet inverse transform algorithm.

According to the method and apparatus provided in the embodiments of thepresent disclosure, after a first illuminance diagram is acquired, asecond illuminance diagram is generated from the first illuminancediagram, wherein the second illuminance diagram is formed by fusing abase layer of which the dynamic range is compressed and detail layers,and wherein the base layer and the detail layers are extracted from thefirst illuminance diagram; then the second illuminance diagram is mappedonto preset color channels, and the images on the color channels arefused into an HDRI. It can be seen that during the process of generatingthe HDRI, only the dynamic range of the base layer in the illuminancediagram is compressed, whereas the detail layers are not compressed.Therefore, the detail information in the original illuminance diagramcan be preserved to the largest extent, thereby avoiding the problem oflosing details during the process of generating the HDRI.

BRIEF DESCRIPTION OF THE DRAWINGS

To more clearly explain the technical solutions of the embodiments ofthe present disclosure, a brief description of the drawings used in thedetailed description of the embodiments is provided as follows. It isapparent for an ordinary person skilled in the art that the drawingsdescribed below are only illustrative of some embodiments of the presentdisclosure, and other drawings can be derived based on those drawingswithout any creative effort.

FIG. 1 is a flowchart of generating a second illuminance diagram from afirst illuminance diagram in a disclosed method for generating HDRIaccording to an embodiment of the present disclosure;

FIG. 2 is another flowchart of generating a second illuminance diagramfrom a first illuminance diagram in a disclosed method for generatingHDRI according to an embodiment of the present disclosure;

FIG. 3 is a flowchart of a disclosed method for generating HDRIaccording to an embodiment of the present disclosure;

FIG. 4 is a curved graph of a camera response function solved in adisclosed method for generating HDRI according to an embodiment of thepresent disclosure;

FIG. 5 is a comparison diagram between HDRIs generated by the disclosedmethod according to the embodiments of the present disclosure and HDRIsgenerated by an existing method; and

FIG. 6 is a structure diagram of an apparatus for generating HDRIaccording to an embodiment of the present disclosure.

DETAIL DESCRIPTION OF THE EMBODIMENTS

The embodiments of the present disclosure provide a method and anapparatus for generating HDRI, which in general only compresses thedynamic range of a base layer of an illuminance diagram and does notcompress the dynamic range of a detail layer of the illuminance diagram,so as to achieve the purpose of preserving details in the image.

The technical solutions of the present disclosure will be described inthe following embodiments with the accompanying drawings. Apparently,the described embodiments are only a part but not all of the embodimentsof the present disclosure. Based on the embodiments of the presentdisclosure, other embodiments may be derived by those skilled in the artwithout any creative effort, all of which shall fall within the scope ofthe present disclosure.

An embodiment of the present disclosure discloses a method forgenerating an HDRI, comprising the following steps:

A: acquiring a first illuminance diagram;

B: generating a second illuminance diagram from the first illuminancediagram;

wherein the second illuminance diagram is formed by fusing a base layerwith a compressed dynamic range and detail layers, and the base layerand the detail layers are extracted from the first illuminance diagram;

C: mapping the second illuminance diagram onto the preset color channelsto obtain images on the preset color channels; and

D: fusing the images on the color channels into the HDRI.

The specific process of step B of this embodiment is shown in FIG. 1 or2.

The method shown in FIG. 1 may include the following steps:

S101: extracting a base layer and detail layers from a first illuminancediagram;

Typically, an illuminance diagram is used to characterize a brightnessvalue of each pixel point in an image. A base layer of the illuminancediagram refers to low frequency information of the illuminance diagram(i.e., the main energy component of the illuminance diagram), while adetail layer refers to high frequency information of the illuminancediagram. Thus, the detail layer comprises detail information in theilluminance diagram.

S102: compressing the dynamic range of the base layer into a presetrange;

The dynamic range refers to the ratio between a maximum value and aminimum value of a physical quantity to be measured, and it may havedifferent meaning for different objects. In terms of a digital image,the dynamic range D refers to the ratio between a maximum brightnessvalue and a minimum brightness value in the digital image:D=L _(max) /L _(min)

wherein the brightness is stated in Candela/square meter (cd/m²).

The capability of simultaneously presenting in an image the details ofan area with a maximum brightness and an area with a minimum brightnessin a natural scene is limited by the dynamic range of the image. In areal natural scene, the brightness has a very broad dynamic range (arange of more than 9 orders of magnitude, e.g., 10⁴˜10⁻⁵ cd/m²), and thehuman vision system is capable of perceiving a scene brightness with adynamic range of about 5 orders of magnitude. However, the brightnessdynamic range that can be achieved by an existing display device may beof about 2 orders of magnitude. Apparently, there would be a mismatchbetween a brightness dynamic range of a natural object seen in a displaydevice and a brightness dynamic range of the natural object seen in areal world.

In this embodiment, the compression of the dynamic range of the baselayer into the preset range can be performed through any appropriatemethod. For example, the dynamic range of the base layer can becompressed into the preset range by multiplying a number less than 1,and the specific value of that number can be set according to the presetrange. In terms of image display, the preset range is the dynamic rangethat can be displayed by a display device. Other methods for setting thepreset range and/or compressing the dynamic range of the base layer canalso be used.

S103: fusing the base layer with the compressed dynamic range and thedetail layers into a second illuminance diagram.

In the method as shown in FIG. 1, when the dynamic range of anilluminance diagram is compressed, only the dynamic range of the baselayer of the illuminance diagram is compressed, while the dynamic rangeof the detail layers thereof is not compressed. Thus, the completenessof the detail information can be preserved to the largest extent,thereby avoiding the loss of the details.

Furthermore, the method as shown in FIG. 2 may comprise:

S201: extracting a base layer and detail layers of a first illuminancediagram by using a lifting wavelet transform algorithm;

In this embodiment, depending on the characteristics of a liftingwavelet operator, the number of the detail layers may be 3. That is, thedetail layers may include detail layers in three different directions.

S202: compressing the dynamic range of the base layer into a presetrange;

S203: fusing the base layer with the compressed dynamic range and thedetail layers into a second illuminance diagram by using a liftingwavelet inverse transform algorithm.

In the method shown in FIG. 2, the lifting wavelet transform algorithmmay be used to extract the base layer and the detail layers from theilluminance diagram, and the lifting wavelet inverse transform algorithmmay be used to merge the base layer with the compressed dynamic rangeand the detail layers. Since the lifting wavelet transform and thelifting wavelet inverse transform are simple and quick, the methoddescribed in the present embodiment is capable of not only avoiding theloss of details of an image but also being done simply and quickly.Therefore, the method may be easily implemented in hardware with highercomputational efficiency.

It should be noted that, the use of the lifting wavelet algorithm isjust an exemplary approach of the present embodiment, which is notintended to be limiting.

The aforementioned method for generating HDRI will be explained indetails below. As shown in FIG. 3, the process for generating HDRI mayspecifically comprise the following steps:

S301: From images I1, I2, . . . , IN, generating a set of calibrationequations of a camera response function, where the images I1, I2, . . ., IN may be a set of images having different exposure conditions and maybe used to generate the HDRI, i.e., the images I1, I2, . . . , IN may beimages corresponding to the HDRI, while N is the total number of theimages, and is an integer greater than or equal to 2.

The specific implementation of step S301 may comprise the followingsteps:

1) acquiring the images I1, I2, . . . , IN; and

2) using the images I1, I2, . . . , IN as known parameters, solving apreset objective function by a least square method to obtain the set ofcalibration equations for the camera response function.

In some embodiments, the objective function may be:

$O = {{\sum\limits_{i = 1}^{M}{\sum\limits_{j = 1}^{N}{{\omega\left( Z_{i,j} \right)}\left\lbrack {{g\left( Z_{i,j} \right)} - {\ln\; E_{i}} - {\ln\;\Delta\; t_{j}}} \right\rbrack}^{2}}} + {\lambda{\sum\limits_{Z = {Z_{\min} + 1}}^{Z_{\max} - 1}{{\omega\left( Z_{i,j} \right)}\left\lbrack {g^{''}\left( z_{i,j} \right)} \right\rbrack}^{2}}}}$

where, M is the total number of the pixel points of each image among theknown parameters, g(Z_(i,j))=InE_(i)+InΔt_(j), E_(i) is a sceneilluminance, Δt_(j) is an exposure time of the current image Z_(i,j)k_(i) is a pixel value of the current image, λ is a control parameter,ω(Z_(i,j)) is a weight function for the current image Z_(i,j), Z_(min)is a minimum value of the pixel value of the current image, and Z_(max)is a maximum value of the pixel value of the current image.

The principle for setting the objective function is as follows:

1) defining the relationship between a camera response curve and a sceneilluminance E_(i), an exposure time Δt_(j) and a pixel value Z_(i,j) ofa digital image as:Z _(i,j) =f(E _(i) ×Δt _(j))

2) assuming the camera response curve is smooth and monotonous such thatthe function f is invertible, and inverting the above equation andtaking the logarithm thereof to let g=Inf⁻¹:g(z _(i,j))=InE _(i) +InΔt _(j)

3) letting the extrema of Z be Z_(min) and Z_(max) to establish thefollowing objective function:

$O = {{\sum\limits_{i = 1}^{M}{\sum\limits_{j = 1}^{N}\left\lbrack {{g\left( Z_{i,j} \right)} - {\ln\; E_{i}} - {\ln\;\Delta\; t_{j}}} \right\rbrack^{2}}} + {\lambda{\sum\limits_{Z = {Z_{\min} + 1}}^{Z_{\max} - 1}\left\lbrack {g^{''}\left( z_{i,j} \right)} \right\rbrack^{2}}}}$

Since there are always overexposed pixel points and underexposed pixelpoints among all the pixel points in an image, a simplest weightfunction is often added into the objective function:

${\omega\left( Z_{i,j} \right)} = \left\{ \begin{matrix}{Z - Z_{\min}} & {Z \leq Z_{mid}} \\{Z_{\max} - Z} & {Z > Z_{mid}}\end{matrix} \right.$

wherein, Z_(mid)(Z_(min)+Z_(max))/2. So, the final objective functionis:

$O = {{\sum\limits_{i = 1}^{M}{\sum\limits_{j = 1}^{N}{{\omega\left( Z_{i,j} \right)}\left\lbrack {{g\left( Z_{i,j} \right)} - {\ln\; E_{i}} - {\ln\;\Delta\; t_{j}}} \right\rbrack}^{2}}} + {\lambda{\sum\limits_{Z = {Z_{\min} + 1}}^{Z_{\max} - 1}{{\omega\left( Z_{i,j} \right)}\left\lbrack {g^{''}\left( z_{i,j} \right)} \right\rbrack}^{2}}}}$

S302: solving the set of calibration equations for the camera responsefunction by using a QR decomposition algorithm to obtain the cameraresponse function and an illuminance logarithm, based on sampling pixelpoints selected from the images I1, I2, . . . , IN;

The QR decomposition algorithm first decomposes a coefficient matrixinto a product of an orthogonal matrix and an upper triangular matrix,and then calculates the result by back substitution. Compared with theexisting solving method of singular value decomposition, the QRdecomposition algorithm is simpler, and thus easier to be implemented inhardware.

A curve representation for the camera response function is shown in FIG.4, with the X-axis represents the pixel value and the Y-axis representsthe value of camera response function.

S303: obtaining the first illuminance diagram based on the cameraresponse function and the illuminance logarithm;

The specific implementation of this step may be any appropriate method.

S304: extracting the base layer and the detail layers in 3 differentdirections of the first illuminance diagram by using a lifting wavelettransform algorithm;

S305: compressing the dynamic range of the base layer into a presetrange;

S306: fusing the base layer of which the dynamic range is compressed andthe detail layers into the second illuminance diagram by using a liftingwavelet inverse transform algorithm;

S307: mapping the second illuminance diagram onto an R, G and B colorchannels;

S308: performing a Gamma correction respectively on the images on the R,G and B color channels;

S309: fusing the Gamma-corrected images on the R, G and B color channelsinto the HDRI.

Since the Gamma correction may correct the brightness deviation of animage displayed on a display, the contrast of HDRI obtained throughmerging the images with Gamma correction can be significantly improved.

As can be seen from the above steps, the method for generating HDRI asdescribed in the present embodiment has a higher execution speed, iseasier to be implemented in hardware, and is able to avoid the loss ofdetails of an image during the process starting from the images I1, I2,. . . , IN to the HDRI. Further, since the details of the image can bepreserved, the occurrence of halos in the HDRI can be reduced to a largeextent; and the HDRI generated by the method of the present embodimentmay have a better contrast.

According to the present disclosure, compared with the existing method,the disclosed method according to the embodiments of the presentdisclosure can obtain clearer HDRIs as shown in FIG. 5, where the leftcolumn shows HDRIs obtained by using the method according to theembodiments of the present disclosure and the right column shows HDRIsobtained by using the existing method. It can be seen from the displayeffect that the details of the left column are clearer, and the contrastthereof is more suitable for viewing by human eyes.

In correspondence to the above method embodiments, an embodiment of thepresent disclosure further provides an apparatus for generating HDRI asshown in FIG. 6, comprising:

an acquisition module 601 for acquiring a first illuminance diagram;

a generation module 602 for generating a second illuminance diagram fromthe first illuminance diagram, wherein the second illuminance diagram isformed by fusing a base layer of which the dynamic range is compressedand detail layers, and wherein the base layer and the detail layers areextracted from the first illuminance diagram;

a mapping module 603 for mapping the second illuminance diagram ontopreset color channels; and

a fusion module 604 for fusing the images on the color channels into theHDRI.

Optionally, the present embodiment may further comprise:

a correction module 605 for performing a Gamma correction respectivelyto the images on each of the color channels before fusing the images onthe color channels into the HDRI.

When the correction module is present, the fusion module may bespecifically used for fusing the Gamma-corrected images on the colorchannels into the HDRI.

The extraction unit may be specifically used for extracting the baselayer and the detail layers of the first illuminance diagram by using alifting wavelet transform algorithm; and the fusion unit may bespecifically used for fusing the base layer of which the dynamic rangeis compressed and the detail layers into the second illuminance diagramby using a lifting wavelet inverse transform algorithm.

In the present embodiment, the acquisition module 601 may specificallycomprise:

an equation generating unit 6011 for generating a set of calibrationequations for a camera response function from images I1, I2, . . . , INhaving different exposure conditions, wherein N is the total number ofthe images, an integer greater than or equal to 2;

a solving unit 6012 for solving the set of calibration equations for thecamera response function by using a QR decomposition algorithm to obtainthe camera response function and a illuminance logarithm, based on thesampling pixel points selected from the images I1, I2, . . . , IN; and

an acquisition unit 6013 for obtaining the first illuminance diagrambased on the camera response function and the illuminance logarithm.

In particular, the specific implementation of the equation generatingunit to generate the set of calibration equations for a camera responsefunction from images I1, I2, . . . , IN may be as follows:

The equation generating unit is specifically used for acquiring theimages I1, I2, . . . , IN, and solving a preset objective function by aleast square method to obtain the set of calibration equations for thecamera response function by using the images I1, I2, . . . , IN as knownparameters.

Further, the preset objective function may be:

$O = {{\sum\limits_{i = 1}^{M}{\sum\limits_{j = 1}^{N}{{\omega\left( Z_{i,j} \right)}\left\lbrack {{g\left( Z_{i,j} \right)} - {\ln\; E_{i}} - {\ln\;\Delta\; t_{j}}} \right\rbrack}^{2}}} + {\lambda{\sum\limits_{Z = {Z_{\min} + 1}}^{Z_{\max} - 1}{{\omega\left( Z_{i,j} \right)}\left\lbrack {g^{''}\left( z_{i,j} \right)} \right\rbrack}^{2}}}}$

where M is the number of the pixel points of each image among the knownparameters, g(Z_(i,j))=InE_(i)+InΔt_(j), E_(i) is a scene illuminance,Δt_(j) is an exposure time of the current image Z_(i,j), Z_(i,j) is apixel value of the current image, λ is a control parameter, ω(Z_(i,j))is a weight function for the current image Z_(i,j), Z_(min) is a minimumvalue of the pixel value of the current image, and Z_(max) is a maximumvalue of the pixel value of the current image.

Particularly in the present embodiment, the generation module 602 mayspecifically comprise:

an extraction unit 6021 for extracting the base layer and the detaillayers of the first illuminance diagram;

a compression unit 6022 for compressing the dynamic range of the baselayer into a preset range; and

a fusion unit 6023 for fusing the base layer of which the dynamic rangeis compressed and the detail layers into the second illuminance diagram.

With the apparatus according to the present embodiment, when the dynamicrange of an illuminance diagram is compressed, only the dynamic range ofa base layer of the illuminance diagram is compressed whereas thedynamic range of detail layers thereof is not compressed. Thus, thecompleteness of the detail information can be preserved to the largestextent, thereby avoiding the loss of details.

Specifically, in the present embodiment, the extraction module mayextract the base layer and the detail layers of the first illuminancediagram by using a lifting wavelet transform algorithm; and the fusionmodule may fuse the base layer with the compressed dynamic range and thedetail layers into the second illuminance diagram by using a liftingwavelet inverse transform algorithm. Since the lifting wavelet transformand its inverse transform are simple and quick, the apparatus describedin the present embodiment is capable of not only avoiding the loss ofdetails of an image but also being done simply and quickly. Therefore,the apparatus may be easily implemented in hardware with highercomputational efficiency.

The functionalities of the method according to the embodiments can bestored in a computing device readable storage medium when implemented inthe form of software. Based on this understanding, part or all of thetechnical solution of the embodiments of the present disclosure can beembodied in the form of a software product stored in a storage mediumcomprising a number of instructions configured to cause the computingdevice (such as a personal computer, a server, a mobile computing deviceor a network device) to execute all or some steps of the methodaccording to various embodiments of the present disclosure. The storagemedium may comprise various mediums such as a flash disk, a removablehard drive, a read only memory (ROM), a random access memory (RAM), amagnetic disk or an optical disk that are capable of storing programcodes.

Various embodiments of the present disclosure are described in aprogressive way. The description of each embodiment is focused on thedifference between that embodiment and the others, and identical orsimilar parts among various embodiments can be referred to each other.

The description of the disclosed embodiments can allow those skilled inthe art to implement or use the present disclosure. Variousmodifications to those embodiments will be apparent to those skilled inthe art, and the general principle defined herein can be implemented inother embodiments without departing from the spirit or scope of thepresent disclosure. Therefore, the present invention will not be limitedto the embodiments disclosed herein, but shall conform to the broadestscope in consistence with the principle and the novel features disclosedherein.

What is claimed is:
 1. A method for generating a high dynamic rangeimage (HDRI) comprising: acquiring a first illuminance diagram,comprising obtaining the first illuminance diagram based on a cameraresponse function and an illuminance logarithm obtained based on aplurality of images having different exposure conditions, the cameraresponse function indicating a mapping relation of a scene illuminanceand an exposure time to a pixel value; generating a second illuminancediagram from the first illuminance diagram by modifying a dynamic rangeof at least a portion of the first illuminance diagram; and generatingthe HDRI based on the second illumination diagram.
 2. The method ofclaim 1, wherein acquiring the first illuminance diagram furthercomprises generating a set of calibration equations for the cameraresponse function from the plurality of images.
 3. The method of claim2, wherein generating the set of calibration equations for the cameraresponse function from the plurality of images comprises: acquiring theplurality of images; and using the plurality of images as knownparameters to solve a preset objective function by a least square methodto obtain the set of calibration equations for the camera responsefunction.
 4. The method of claim 2, wherein acquiring the firstilluminance diagram further comprises solving the set of calibrationequations for the camera response function to obtain the camera responsefunction and the illuminance logarithm.
 5. The method of claim 4,wherein solving the set of calibration equations comprises solving theset of calibration equations by using a QR decomposition algorithm. 6.The method of claim 4, wherein solving the set of calibration equationscomprises solving the calibration equations based on sampling pixelpoints selected from the plurality of images.
 7. The method of claim 1,wherein generating the second illuminance diagram from the firstilluminance diagram comprises: extracting from the first illuminancediagram a base layer and one or more detail layers, the base layercontaining low frequency information of the first illuminance diagramand the one or more detail layers containing high frequency informationof the first illuminance diagram; compressing a dynamic range of thebase layer while maintaining a dynamic range of each of the one or moredetail layers uncompressed; and generating the second illuminancediagram by fusing the base layer with the compressed dynamic range andthe one or more detail layers.
 8. The method of claim 7, wherein:extracting the base layer and the one or more detail layers comprisesextracting the base layer and the one or more detail layers using alifting wavelet transform algorithm; and fusing the base layer with thecompressed dynamic range and the one or more detail layers into thesecond illuminance diagram comprises fusing the base layer with thecompressed dynamic range and the one or more detail layers into thesecond illuminance diagram using a lifting wavelet inverse transformalgorithm.
 9. The method of claim 1, wherein generating the HDRI basedon the second illumination diagram comprises: mapping the secondilluminance diagram onto a plurality of preset color channels to obtaina plurality of images on the plurality of preset color channels; andfusing the plurality of images on the plurality of preset color channelsinto the HDRI.
 10. The method of claim 9, further comprising, beforefusing the plurality of images on the plurality of preset color channelsinto the HDRI: performing Gamma correction on the plurality of images onthe plurality of preset color channels; wherein fusing the plurality ofimages on the plurality of preset color channels into the HDRI comprisesfusing the Gamma-corrected images on the preset color channels into theHDRI.
 11. An apparatus for generating a high dynamic range image (HDRI)comprising: a non-transitory computer-readable storage medium storinginstructions; and a computing device coupled to the storage mediumexecuting the instructions to: acquire a first illuminance diagram,comprising obtaining the first illuminance diagram based on a cameraresponse function and an illuminance logarithm obtained based on aplurality of images having different exposure conditions, the cameraresponse function indicating a mapping relation of a scene illuminanceand an exposure time to a pixel value; generate a second illuminancediagram from the first illuminance diagram by modifying a dynamic rangeof at least a portion of the first illuminance diagram; and generate theHDRI based on the second illumination diagram.
 12. The apparatus ofclaim 11, wherein the computing device further executes the instructionsto generate a set of calibration equations for the camera responsefunction from the plurality of images.
 13. The apparatus of claim 12,wherein the computing device further executes the instructions to:acquire the plurality of images; and use the plurality of images asknown parameters to solve a preset objective function by a least squaremethod to obtain the set of calibration equations for the cameraresponse function.
 14. The apparatus of claim 12, wherein the computingdevice further executes the instructions to solve the set of calibrationequations for the camera response function to obtain the camera responsefunction and the illuminance logarithm.
 15. The apparatus of claim 14,wherein the computing device further executes the instructions to solvethe set of calibration equations by using a QR decomposition algorithm.16. The apparatus of claim 14, wherein the computing device furtherexecutes the instructions to solve the calibration equations based onsampling pixel points selected from the plurality of images.
 17. Theapparatus of claim 11, wherein the computing device further executes theinstructions to: extract from the first illuminance diagram a base layerand one or more detail layers, the base layer containing low frequencyinformation of the first illuminance diagram and the one or more detaillayers containing high frequency information of the first illuminancediagram; compress a dynamic range of the base layer while maintaining adynamic range of each of the one or more detail layers uncompressed; andgenerate the second illuminance diagram by fusing the base layer withthe compressed dynamic range and the one or more detail layers.
 18. Theapparatus of claim 17, wherein the computing device further executes theinstructions to: extract the base layer and the one or more detaillayers using a lifting wavelet transform algorithm; and fuse the baselayer with the compressed dynamic range and the one or more detaillayers into the second illuminance diagram using a lifting waveletinverse transform algorithm.
 19. The apparatus of claim 11, wherein thecomputing device further executes the instructions to: map the secondilluminance diagram onto a plurality of preset color channels to obtaina plurality of images on the plurality of preset color channels; andfuse the plurality of images on the plurality of preset color channelsinto the HDRI.
 20. A method for generating a high dynamic range image(HDRI) comprising: acquiring a first illuminance diagram, comprising:generating a set of calibration equations for a camera response functionfrom a plurality of images having different exposure conditions;solving, using a QR decomposition algorithm, the set of calibrationequations to obtain the camera response function and an illuminancelogarithm; and obtaining the first illuminance diagram based on thecamera response function and the illuminance logarithm; generating asecond illuminance diagram from the first illuminance diagram bymodifying a dynamic range of at least a portion of the first illuminancediagram; and generating the HDRI based on the second illuminationdiagram.